package com.hsgene.order.exception;

import com.hsgene.common.util.exception.ErrorCode;

/**
 * 对象属性信息枚举
 *
 * @author wxf
 * @date 2018/10/19 15:00
 **/
public enum ObjectAttributeInfoEnum implements ErrorCode {

    /**
     *
     */
    packageId(90001, "packageId", "套餐id不能为空"),
    packageName(90001, "packageName", "套餐名称不能为空"),
    agencyId(90001, "agencyId", "检测机构id不能为空"),
    agencyName(90001, "agencyName", "机构名称不能为空"),
    agencyCode(90001, "agencyCode", "机构条码不能为空"),
    sampleBarCode(90001, "sampleBarCode", "样本条码不能为空"),
    sampleType(90001, "sampleType", "样本类型不能为空"),
    error(90001, "error", "数据参数异常"),
    id(90001, "id", "疾病id不能为空"),
    diseaseName(90001, "diseaseName", "疾病名不能为空"),
    diseaseType(90001, "diseaseType", "疾病类型不能为空"),
    userName(90001, "userName", "用户名不能为空"),
    userId(90001, "userId", "用户id不能为空"),
    userType(90001, "userType", "用户类型不能为空"),
    testingPurpose(90001, "testingPurpose", "检测目的不能为空"),
    testingTime(90001, "testingTime", "预约检测时间不能为空"),
    collectDate(90001, "collectDate", "采样时间不能为空"),
    geneticPoint(90001, "geneticPoint", "基因位点不能为空"),
    medicineNames(90001, "medicineNames", "药物名称不能为空"),
    therapyType(90001, "therapyType", "治疗类型不能为空"),
    platform(90001, "platform", "订单来源不能为空"),
    memberId(90001, "memberId", "医生id不能为空"),
    memberName(90001, "memberName", "医生姓名不能为空"),
    orderNo(90001, "orderNo", "订单号不能为空"),
    orderId(90001, "orderId", "订单id不能为空"),
    patientName(90001, "patientName", "病患姓名不能为空"),
    createTime(90001, "createTime", "下单时间不能为空"),
    difuId(90001, "difuId", "地服id不能为空"),
    difuName(90001, "difuName", "地服姓名不能为空"),
    operatorId(90001, "operatorId", "操作人id不能为空"),
    operator(90001, "operator", "操作人姓名不能为空"),
    operationTime(90001, "operationTime", "操作时间不能为空"),
    totalCharges(90001, "totalCharges", "金额和积分不能为空"),
    totalCommission(90001, "totalCommission", "金额和积分不能为空"),
    unDefault(90001, "unDefault", "未定义字段异常"),
    invoiceType(90001, "invoiceType", "发票类型不能为空"),
    invoiceName(90001, "invoiceName", "发票名称不能为空"),
    taxesNo(90001, "taxesNo", "纳税号不能为空"),
    invoiceStatus(90001, "invoiceStatus", "发票状态不能为空"),
    enterpriseSealVoucher(90001, "enterpriseSealVoucher", "企业盖章凭证图片不能为空"),
    invoiceId(90001, "invoiceId", "发票id不能为空"),
    sampleId(90001, "sampleId", "套餐样本id不能为空"),
    bloodSampleImages(90001, "bloodSampleImages", "采血管照片不能为空"),
    whiteCount(90001, "whiteCount", "白片数量不能为空"),
    hospitalCode(90001, "hospitalCode", "医院编码不能为空"),
    fee(90001, "fee", "费用不能为空");

    private final int code;

    private final String message;

    private final String description;

    public static ObjectAttributeInfoEnum getEnum(String message) {
        for (ObjectAttributeInfoEnum infoEnum : values()) {
            if (infoEnum.message.equals(message)) {
                return infoEnum;
            }
        }
        return unDefault;
    }

    ObjectAttributeInfoEnum(int code, String message, String description) {
        this.code = code;
        this.message = message;
        this.description = description;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public String getDescription() {
        return description;
    }
}
